﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vit.Data
{
    public class EntityProperty
    {
        public static bool operator ==(EntityProperty a, EntityProperty b)
        {
            return string.Equals(a.Name, b.Name, StringComparison.OrdinalIgnoreCase);
        }

        public static bool operator !=(EntityProperty a, EntityProperty b)
        {
            return !string.Equals(a.Name, b.Name, StringComparison.OrdinalIgnoreCase);
        }

        public override bool Equals(object obj)
        {
            if(obj is EntityProperty)
                return string.Equals(((EntityProperty)obj).Name, this.Name, StringComparison.OrdinalIgnoreCase);
            return false;
        }

        public override int GetHashCode()
        {
            return Name.GetHashCode();
        }

        public string Name { get; set; }
        public object Value { get; set; }
        public object OriginalValue { get; set; }
        public EntityState State { get; set; }
    }
}
